The present invention relates to an image processing device, an endoscope apparatus, an image processing method, and the like.
A plurality of images that differ in focus state (hereinafter may be referred to as “differently-focused images”) may be synthesized to generate an image in which a wide area (entire area in a narrow sense) is in focus (hereinafter may be referred to as “all-in-focus image”). The focus state changes depending on the control state of the optical system (e.g., focus lens), and a plurality of differently-focused images differ from each other as to the in-focus object plane position that represents the position of the object that is in an in-focus state, for example.
For example, JP-A-2013-84152 discloses a method that calculates a focus position probability distribution (i.e., the probability distribution with respect to the focus position) corresponding to each pixel position, and generates a synthesized image (all-in-focus image) using an optimum focus position calculated based on the focus position probability distribution.
According to JP-A-2013-84152, the focus position is estimated on a pixel basis by calculating the intensity of the frequency component from the grayscale image of the captured image (i.e., brightness information) to generate the synthesized image.